#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int uniquePaths(int m, int n)
{
    int dp[m][n];
    int i = 0;
    int j = 0;
    for (i = 0; i < m; i++)
    {
        dp[i][0] = 1;
    }
    for (j = 0; j < n; j++)
    {
        dp[0][j] = 1;
    }
    for (i = 1; i < m; i++)
    {
        for (j = 1; j < n; j++)
        {
            dp[i][j] = dp[i][j - 1] + dp[i - 1][j];
        }
    }
    return dp[m - 1][n - 1];
}